import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    n:1
  },
  getters: {
    money(state){
      return "￥"+state.n
    }
  },
  mutations: {
    jiajia(state,m){
        state.n +=m;
    }
  },
  actions: {
    jia({commit}){
      setTimeout(()=>{
        commit("jiajia",1)
      },3000)
    }
  },
  modules: {
  }
})
